home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
DATABASE.DIR
/
00108_Script_CHECK DATABASE - BROWSER
< prev
next >
Wrap
Text File
|
1996-03-28
|
1KB
|
41 lines
-- --------------------------------------------------------------
-- Handler checkArticleCasts checks that every topic in the field
-- "BrowserTopics" has an associated article field. Errors are
-- place in the field "browserTopics without articles"
on checkArticleCasts numLinesPerBrowserTopic
if voidP(numLinesPerBrowserTopic) then
set numLinesPerBrowserTopic = 1
end if
set browserTopics = field "browserTopics"
set numLines = the number of lines in browserTopics
set numTopics = (numLines - (numLines/numLinesPerBrowserTopic -1)) / numLinesPerBrowserTopic
put EMPTY into field "browserTopics without articles"
set curLine = 1
-- go through the browser topics one by one
repeat while (curLine <= numLines)
set curTopic = line curLine of browserTopics
put "checking" && curtopic
if (curTopic <> EMPTY) then
set articleCast = the number of cast (curTopic && "TEXT1")
if (articleCast = -1) then
-- browserTopic error
put curTopic & RETURN after field "browserTopics without articles"
end if -- articleCast = -1
end if
if (numLinesPerBrowserTopic = 1) then -- no return between lines
set curLine = curLine + 1
else
set curLine = curLine + numLinesPerBrowserTopic + 1 -- +1 for the RETURN
end if
end repeat -- going through the topics
end